package com.focusai.efairy.model.response;

import com.focusai.efairy.model.report.AlarmDataEntity;
import com.focusai.efairy.model.report.AlarmScaleMapEntity;
import com.focusai.efairy.model.report.AnalyseDataType;

import java.util.List;

/**
 * Created by luo_guangwen on 2017/9/22.
 */

public class ReportDataResponse {
    public AnalyseDataType overview;
    public List<AlarmScaleMapEntity> alarm_scale_map_list;
    public List<AlarmDataEntity> alarm_data_list;

    /**
     * 求位点数
     */
    public int getDeviceInstallNum() {
        int count = 0;
        if (overview != null && overview.overview_analyze_list != null) {
            for (AnalyseDataType.OverviewAnalyze item : overview.overview_analyze_list) {
                count += item.install_number;
            }
        }
        return count;
    }

    /**
     * 求位报警数点数
     */
    public int getDeviceAlarmNum() {
        int count = 0;
        if (overview != null && overview.overview_analyze_list != null) {
            for (AnalyseDataType.OverviewAnalyze item : overview.overview_analyze_list) {
                count += item.alarm_number;
            }
        }
        return count;
    }

    /**
     * 求报警数总数
     */
    public int getDeviceTotalWarningNum() {
        return alarm_data_list != null ? alarm_data_list.size() : 0;
    }
}
